<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%
	String bathPath = request.getContextPath();
	pageContext.setAttribute("bathPath", bathPath);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script type="text/javascript" src="${bathPath}/js/jquery-1.9.1.min.js" ></script>
<link rel="stylesheet" href="${bathPath}/frame/layui/css/layui.css"  media="all">
<script src="${bathPath}/frame/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<link rel="stylesheet" href="${bathPath}/layui_ext/dtree/dtree.css">
<link rel="stylesheet" href="${bathPath}/layui_ext/dtree/font/dtreefont.css">
</head>
<style type="text/css"> 
.layui-table-cell .layui-form-checkbox[lay-skin="primary"]{
     top: 50%;
     transform: translateY(-50%);    
}
</style>
<body>
<div class="layui-tab" lay-filter="demo" lay-allowclose="true" style="height:490px;width:910px;margin-left:20px;">
  <ul class="layui-tab-title">
    <li lay-id="22">人员权限管理</li>
  </ul>
  <div class="layui-tab-content" style="height:450px; width:910px">
    <div class="layui-tab-item layui-show" >
<form class="layui-form layui-form-pane"  id="myform" method="post" action="" showOnMouseOver="false"> 
<input type="hidden" id="autoid" name="autoid" value="${doorBean.autoid}">
<div class="layui-tab layui-tab-card">
  <ul class="layui-tab-title">
    <li class="layui-this">人员权限管理</li>
    <li>控制器下载失败记录</li>
  </ul>
  <div class="layui-tab-content" style="height:387px;">
  		<!--人员权限管理 -->
  		<div class="layui-tab-item layui-show">
	    <!--     <table class="param_table" style="width:900px;border-collapse:separate;margin-left:7px;">
	        	<tr>
	        		<td><button class="layui-btn site-demo-active get-checked" style="margin-left:2px;">人员门禁授权</button></td>
	        		<td><button class="layui-btn site-demo-active get-checked" style="margin-left:10px;">人员权限取消</button></td>
	        		<td style="font-size:8px;margin-top:20px;padding-left:15px;">
	        			<span>人员</span>
	        			<br/>
	        			<span>卡号</span>
	        			<span>人员、卡号</span>
	        		</td>
	        		<td><input class="layui-input"  name=""  id="" autocomplete="off" style="width:150px;"></td>
	        		<td align="left" ><a class="layui-btn" data-type="reload" onclick="selectall()">搜索</a></td>
	        		<td style="width:160px;height:50px;padding-left:10px;">
	        			<select name=""  id="" class="layui-form-label"> 
					    	<option value="">--请选择--</option>
					    	<option value="联想">显示全部</option>
					    	<option value="联想">已授权</option>
					    	<option value="雷神">未授权</option>
					    </select>
	        		</td>
	        		<td><input type="radio"  name="xz" lay-skin="primary" title="全部" checked="" value="0"></td>
	        		<td><input type="radio"  name="xz" lay-skin="primary" title="正常" value="0"></td>
	        		<td><input type="radio"  name="xz" lay-skin="primary" title="过期" value="0"></td>
	        	</tr>
	        </table> -->
	        
	        	<!--树形  -->
				<div style="height:380px;width:200px;overflow:auto;" id="toolbarDiv">
					<ul id="demoTree1" class="dtree" data-id="0" style="width:180px;height:330px;"></ul>
				</div>
				
				<!--上页面 -->
				<div>
					<iframe id="myIframe" name="mainIframe" frameborder="0" style="width:710px;min-width:710px;margin-left:210px;height:390px;margin-top:-385px;" src="${bathPath}/aDKUserInfo/findId3.action?depid=@">
					</iframe>
				</div>
				
				<!--下页面-->
				<%-- <div>
					<iframe id="myIframe" name="mainIframe" frameborder="0" style="border:1px solid red;width:690px;min-width:690px;margin-left:210px;height:160px;margin-top:-162px;" src="${bathPath}/aDKUserGroup/UserGroupTop.action?autoId=1">
					</iframe>
				</div> --%>
				<!-- <table class="layui-table layui-form" id="test-tree-table"></table> -->
    </div>
    	<!--控制器下载失败记录 -->
	    <div class="layui-tab-item">
	    	<div>
	      		<div style="width:330px; height:300px;background-color:white;opacity:0.1;margin-top:50px;z-index:9999; position:fixed;" ></div>
		      		<table class="param_table" style="border-collapse:separate; border-spacing:0px 3px; width:325px; margin-left:7px;">
		      		</table>
	        </div>
	    </div>
   </div>
</div>
</form>
</div>
<table class="layui-hide"  id="demo"></table>
<table class="layui-hide"  id="test"  lay-filter="test"></table>
</div>
</div>
<script src="${bathPath}/frame/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use('form', function(){
	  var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
	  form.render();
	});
	
		layui.use('element', function() {
				var $ = layui.jquery, element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

				//触发事件
				var active = {
					tabAdd : function() {
						//console.log(url);
						//新增一个Tab项
						element.tabAdd('demo', {
							title : $(this).attr("data-title"), //用于演示
							
							content : '<iframe data-frameid="'+$(this).attr("data-id")+'" scrolling="auto" frameborder="0" src="'+$(this).attr("data-url")+'" style="width:1220px;height:650px;"></iframe>' ,
							id : $(this).attr("data-id")
						//实际使用一般是规定好的id，这里以时间戳模拟下
						})
						var id = $(this).attr("data-id");
						
						element.tabChange('demo', id); //切换到：用户管理
		                $("iframe[data-frameid='" + id + "']").attr("src", $("iframe[data-frameid='" + id + "']").attr("src"))//切换后刷新框架
					   
					},
					tabDelete : function(othis) {
						//删除指定Tab项
						element.tabDelete('demo', '44'); //删除：“商品管理”

						othis.addClass('layui-btn-disabled');
					},
					tabChange : function() {
						//切换到指定Tab项
						element.tabChange('demo', '22'); //切换到：用户管理
					}
				};

				$('.site-demo-active').on('click', function() {
					var othis = $(this), type = othis.data('type');
					active[type] ? active[type].call(this, othis) : '';
				});

				//Hash地址的定位
				var layid = location.hash.replace(/^#test=/, '');
				element.tabChange('test', layid);

				element.on('tab(test)', function(elem) {
					location.hash = 'test=' + $(this).attr('lay-id');
				});

			});
	</script>
	
<script src="${bathPath}/frame/layui/layui.js" charset="utf-8"></script>
<script>
var jiedian;
var depid;
$(function(){
	$.ajax({
		type:"POST",
		async:false,  //默认true,异步
		url:"${bathPath}/aDKDept/selectAll.action",
		success:function(data){
	      jiedian=data.data;
	      layui.config({
			  base: '${bathPath}/layui_ext/dtree/' //配置 layui第三方扩展组件存放的基础目录
			}).extend({
			  dtree: 'dtree' //定义该组件模块名
			}).use(['element','layer', 'dtree'],function(){
				var layer = layui.layer,
				    dtree = layui.dtree,
				    $ = layui.$;
				dtree.render({
				  elem: "#demoTree1", //绑定元素
				  //url:"${bathPath}/aDKDept/deptTree.action",
				  data: data,  //数据
			      checkbar: true,   //开启复选框
				  checkbarType:"all"//开启复选框
				});
				//单击节点 监听事件
				dtree.on("node('demoTree1')" ,function(param){
					//回填页面
					$("#myIframe").attr("src","${bathPath}/aDKUserInfo/findId3.action?depid="+param.param.nodeId);
					depid=param.param.nodeId;
					//alert(autoId);
				});
			});
	    }
	});
}); 
</script>
</body>
</html>